package com.gitee.wsl.func.predicate


abstract class MapEntryPredicate<T1, T2>
    : Predicate<Map.Entry<T1,T2>>, Predicate2<T1,T2> {

    override fun accept(t: Map.Entry<T1,T2>): Boolean {
        return this.accept(t.key, t.value)
    }

    override fun negate(): MapEntryPredicate<T1,T2> {
        return object : MapEntryPredicate<T1,T2>() {
            override fun test(t: Map.Entry<T1,T2>): Boolean {
                return !this@MapEntryPredicate.accept(t)
            }

            public override fun test(a: T1, b: T2): Boolean {
                return !this@MapEntryPredicate.accept(a, b)
            }
        }
    }

}
